package com.xhwl.logistics.bo;

import com.xhwl.logistics.constant.VehicleConstant;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

@Setter
@Getter
public class VehicleAccessRecordBO {

    private final static BigDecimal bigDecimal = new BigDecimal(100);

    private String projectName;


    private String plateNumber;

//    private String homeAddress;

    private String cardType;


    private Date enterTime;

    private String enterType;

    private String enterPictureUrl;

    private String enterPassage;


    private Date exitTime;

    private String exitType;

    private String exitPictureUrl;

    private String exitPassage;

    private String passType;


//    private String stayTime;

//    private Boolean overnight;


    private String ownerName;

    private String ownerPhoneNumber;


    private Integer paidMoney;

    public String paidMoneyString() {
        if (Objects.nonNull(paidMoney)) {
            return new BigDecimal(paidMoney).divide(bigDecimal, VehicleConstant.VEHICLE_PAY_RECORD_SCALE, VehicleConstant.VEHICLE_PAY_RECORD_ROUNDING_MODE).toString();
        }
        return null;
    }

}
